
export const isExternal = (url = "") => {
  return /^https?:\/\//.test(url) || url.startsWith("//");
};

export const joinUrl = (path1: string, path2: string) => {
  return (path1 || '').replace(/\/$/, "") + "/" + (path2 || '').replace(/^\//, "");
}
export const normalModule = (loadModule)=>{
  return loadModule.default ? loadModule.default : loadModule;
}
export const baseName = (baseName: string, path: string) => {
  if (!path) {
    return '';
  }
  if (path.startsWith(baseName)) {
    return path
  }
  return baseName + path
}